package com.lihui.TCP;

import java.io.IOException;
import java.util.Scanner;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2023/02/28  14:26
 */
public class TCPMegServer extends TCPEchoServer{

    public TCPMegServer(int port) throws IOException {
        super(port);
    }

    @Override
    protected String process(String request) {
        //1.打印发送发发来的信息
        System.out.println("->" + request) ;
        //2.回复对方消息
        Scanner scanner = new Scanner(System.in);
        String response = scanner.nextLine();
        return response;
    }

    public static void main(String[] args) throws IOException {
        TCPMegServer server = new TCPMegServer(9090);
        server.start();
    }
}
